package exam.wzb.jsp.service.impl;

import exam.wzb.jsp.dao.UserDao;
import exam.wzb.jsp.dao.impl.UserDaoImpl;
import exam.wzb.jsp.model.User;
import exam.wzb.jsp.service.UserService;

public class UserServiceImpl implements UserService {

    private UserDao userDao = new UserDaoImpl();
    @Override
    public User login(String username, String password) {
        User user = userDao.findUserByUsername(username);
        if (user != null && user.getPassword().equals(password)) {
            return user;
        }
        return null;
    }

    @Override
    public User reg() {
        return null;
    }
}
